package com.example.dqnm.controller;

import com.example.dqnm.pojo.ajaxResult;
import com.example.dqnm.service.IndexService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RequiredArgsConstructor
@RestController
@RequestMapping("/index")
public class IndexController {
    @Autowired
    private IndexService indexService;
    @GetMapping("/findBanner")
    public ajaxResult<ArrayList> findBanner() {
        ArrayList result = indexService.findBanner();
        return new ajaxResult<>(result);
    }

    @GetMapping("/findProductType")
    public ajaxResult<ArrayList> findProductType() {
        ArrayList result = indexService.findProductType();
        return new ajaxResult<>(result);
    }
}
